﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;
using System.Reflection;
using System.Web.Services;
using System.Web.Script.Services;
using ForumLibrary.Data;


public partial class Posts : System.Web.UI.Page
{
    private string _ForumName;
    private string _ThreadName;

    protected void Page_Load(object sender, EventArgs e)
    {
        this._ForumName = Request.Params["Topic"];
        this._ThreadName = Request.Params["Thread"];
        SiteMapUpdater._ForumName = _ForumName;
        SiteMapUpdater._ThreadName = _ThreadName;

    }


    private SiteMapNode ExpandForumPaths(Object sender, SiteMapResolveEventArgs e)
    {
        // The current node represents a Post page in a bulletin board forum.
        // Clone the current node and all of its relevant parents. This
        // returns a site map node that a developer can then
        // walk, modifying each node.Url property in turn.
        // Since the cloned nodes are separate from the underlying
        // site navigation structure, the fixups that are made do not
        // effect the overall site navigation structure.
        SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);
        SiteMapNode tempNode = currentNode;

        // Obtain the recent IDs.
        string forumID = _ForumName;

        // The current node, and its parents, can be modified to include
        // dynamic querystring information relevant to the currently
        // executing request.

        if ((null != (tempNode = tempNode.ParentNode)) &&
            (null != forumID))
        {
            tempNode.Url = tempNode.Url + "?Topic=" + forumID.ToString();
        }

        return currentNode;
    }

   
}